<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link th:href="@{/erp/assets/css/codemirror.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <script th:src="@{/erp/assets/js/jquery.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <!-- page specific plugin scripts -->
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
</head>
<body>

<!--编辑区域分配图层-->
<form>
    <div class="edit_menber" id="edit_menber_style">
        <input type="hidden" name="id" th:value="${param.id}">
        <ul class=" page-content">
            <div class="Operate_cont clearfix">
                <div class="brand_detailed">
                    <ul class="Info_style clearfix" style="width:510px; margin-top:0px;">
                        <li><label class="label_name">仓库编号：</label>
                            <span class="name">
                          <input name="warehouseNo" required th:value="${param.warehouseNo}" type="text" class="text_add"
                                 style="width:140px;">
                        </span>
                        </li>
                        <li><label class="label_name">仓库名称：</label>
                            <span class="name">
                            <input name="warehouseName" required th:value="${param.warehouseName}" type="text" class="text_add"
                                   style="width:140px;">
                        </span>
                        </li>
                        <li><label class="label_name">负责人：</label>
                            <span class="name">
                            <input name="warehousePerson" required th:value="${param.warehousePerson}" type="text"
                                   class="text_add" style="width:140px;" >
                        </span></li>
                        <li><label class="label_name">联系电话：</label>
                            <span class="name">
                            <input name="personTel" pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$"  type="text" required th:value="${param.personTel}" class="text_add"
                                   style="width:140px;" >
                        </span>
                        </li>
                        <li><label class="label_name">货区数目：</label>
                            <span class="name">
                            <input name="" th:value="${param.areaNum}" required readonly type="text" class="text_add"
                                   style="width:140px;">
                        </span></li>
                        <li>
                            <label class="label_name">货架数目：</label>
                            <span class="name">
                            <input name="" th:value="${param.shelfNum}" required readonly type="text" class="text_add"
                                   style="width:140px;">
                        </span>
                        </li>
                        <li><label class="label_name">货位数目：</label>
                            <span class="name">
                            <input name="" th:value="${param.csNum}" readonly type="text" class="text_add"
                                   style="width:140px;">
                        </span>
                        </li>
                        <li><label class="label_name">空置货位：</label>
                            <span class="name">
                                 <input name="" th:value="${param.vcsNum}" readonly type="text" class="text_add"
                                        style="width:140px;">
                            </span>
                        </li>
                        <li style="width:500px;"><label class="label_name">详细地址：</label>
                            <span class="name">
                                <input name="warehouseAddress" required th:value="${param.warehouseAddress}" type="text"
                                       class="text_add" style="width:380px;">
                            </span>
                        </li>
                        <!-- <li style="width:500px;"><label class="label_name">经纬度：</label>
                             <span class="name">
                                 <input name="" type="text" class="text_add"  style="width:380px;" value="57.00214,65.012414"  >
                             </span>
                         </li>-->
                        <li><label class="label_name">创建时间：</label>
                            <span class="name" th:text="${param.createTime}"></span>
                        </li>
                        <li><label class="label_name">状态：</label>
                            <span class="name" th:if="${param.warehouseStatus[0]} eq '1' ">
                            <input type="radio" th:value="1" checked class="input-text" placeholder=""
                                   name="warehouseStatus">已启用&nbsp;&nbsp;
                           <input type="radio" th:value="2" class="input-text" placeholder=""
                                  name="warehouseStatus">已停用
                        </span>
                            <span class="name" th:if="${param.warehouseStatus[0]} eq '2' ">
                            <input type="radio" th:value="1" class="input-text" placeholder=""
                                   name="warehouseStatus">已启用&nbsp;&nbsp;
                           <input type="radio" checked th:value="2" class="input-text" placeholder=""
                                  name="warehouseStatus">已停用
                        </span>
                        </li>
                        <li class="b_Introduce"><label class="label_name">仓库描述：</label><br/>
                            <span class="name">
                            <textarea name="warehouseRemark" required cols="40" rows="8"
                                      th:text="${param.warehouseRemark}"></textarea>
                        </span>
                        </li>
                        <div class="" style=" text-align:center">
                            <input class="btn btn-primary" id="tijiao" type="submit" value="提交">
                            <input class="btn btn-primary" id="tijiao1" type="reset" value="取消">
                        </div>

                    </ul>

                </div>
            </div>
        </ul>
    </div>
</form>
<script>
    $(function () {
        $('form').submit(function () {
            var data = $('form').serialize();
            $.post('/warehouse/update', data, function (res) {
                if (res.rs) {
                    parent.layer.msg(res.msg, {icon: 1});
                    $('#btn',parent.window.document).click();
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            })
            return false;
        });

        $('#tijiao1').on('click', function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        });
    })

</script>
</body>
</html>